<?php
$file = 'somefile.html';
$time = microtime(true);

for($i=0; $i<1000000; $i++)
{
	//$test = substr_replace($file, '.php', strrpos($file, '.'));
	
	$test = substr($file, 0, -1*strlen(strrchr($file, '.'))).'.php';
	//$test = preg_replace('/\.[^\.]+$/', '.php', $file);
};

print(microtime(true) - $time);
?>